package bairui.international.model.domain.jpa;

import com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue;

/**
 *
 * (电子券单)TB_ElectronicTicketOrder
 *
 * @说明
 * <pre>

 * </pre>
 *
 * @see Help_TB_ElectronicTicketOrder#inheritance() 继承体系信息
 *
 */
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate

@javax.persistence.Entity(name="t_electronicTicketOrder")
@com.lianjing.sh.processing.info.annotation.GenerateInfoModel
@SuppressWarnings("serial")
@com.lianjing.sh.model.common.annotation.Comment("电子券单")
@com.lianjing.sh.processing.info.annotation.InfoComment("电子券单")
public class TB_ElectronicTicketOrder
 extends TBSuper_BaseIDAndTimeAndOrderValue
 implements 
	com.lianjing.sh.model.common.stardard.TableModel<Long>,
	com.sh_lianjing.state.HasStatable,
	java.io.Serializable

{

	
	
	/**
	 * 必须属性赋值接口
	 */
	public static interface MustProperties{
		/** 编号 */
		public String getNumber();
		/** 标题 */
		public String getName();
		/** 面值 */
		public Double getPrice();
		/** 类型 */
		public bairui.international.model.type.Type_ElectronicTicket getType();
		/** 数量 */
		public Long getCount();
		/** 是否一次性 */
		public Boolean getOneuseFlag();
		/** 是否可赠送 */
		public Boolean getGiveFlag();
		/** 是否可再次领取 */
		public Boolean getAgainFlag();
		/** 状态 */
		public bairui.international.model.status.State_ElectronicTicketOrder getState();
		/** 有效期 */
		public java.util.Date getExpiryDate();
	}
	
	/**
	 * 为必须属性赋值
	 */
	public TB_ElectronicTicketOrder properties(MustProperties properties) {
		this.setNumber(properties.getNumber());
		this.setName(properties.getName());
		this.setPrice(properties.getPrice());
		this.setType(properties.getType());
		this.setCount(properties.getCount());
		this.setOneuseFlag(properties.getOneuseFlag());
		this.setGiveFlag(properties.getGiveFlag());
		this.setAgainFlag(properties.getAgainFlag());
		this.setState(properties.getState());
		this.setExpiryDate(properties.getExpiryDate());
		return this;
	}
	
	/**
	 *	必须属性构造函数
	 */
	public TB_ElectronicTicketOrder(MustProperties properties) {
		this.properties(properties);
	}
	
	
	/**
	 * 可选单属性赋值接口
	 */
	public static interface OptionalSingleProperties{
		/** 申请时间 */
		public java.util.Date getApplyDate();
		/** 生成时间 */
		public java.util.Date getGenerateDate();
		/** 发布者 */
		public bairui.international.model.domain.jpa.TB_Admin getPublishor();
		/** 备注 */
		public String getComment();
	}
	
	/**
	 * 为可选单属性赋值
	 */
	public TB_ElectronicTicketOrder properties(OptionalSingleProperties properties) {
		this.setApplyDate(properties.getApplyDate());
		this.setGenerateDate(properties.getGenerateDate());
		this.setPublishor(properties.getPublishor());
		this.setComment(properties.getComment());
		return this;
	}
	
	
	
	public TB_ElectronicTicketOrder(MustProperties must, OptionalSingleProperties optionalSingle) {
		this.properties(must);
		this.properties(optionalSingle);
	}
	
	/**
	 * 仅当前必须属性赋值接口
	 */
	public static interface CurrentMustProperties{
		/** 编号 */
		public String getNumber();
		/** 标题 */
		public String getName();
		/** 面值 */
		public Double getPrice();
		/** 类型 */
		public bairui.international.model.type.Type_ElectronicTicket getType();
		/** 数量 */
		public Long getCount();
		/** 是否一次性 */
		public Boolean getOneuseFlag();
		/** 是否可赠送 */
		public Boolean getGiveFlag();
		/** 是否可再次领取 */
		public Boolean getAgainFlag();
		/** 状态 */
		public bairui.international.model.status.State_ElectronicTicketOrder getState();
		/** 有效期 */
		public java.util.Date getExpiryDate();
	}
	
	/**
	 * 为仅当前必须属性赋值
	 */
	public TB_ElectronicTicketOrder properties(CurrentMustProperties properties) {
		this.setNumber(properties.getNumber());
		this.setName(properties.getName());
		this.setPrice(properties.getPrice());
		this.setType(properties.getType());
		this.setCount(properties.getCount());
		this.setOneuseFlag(properties.getOneuseFlag());
		this.setGiveFlag(properties.getGiveFlag());
		this.setAgainFlag(properties.getAgainFlag());
		this.setState(properties.getState());
		this.setExpiryDate(properties.getExpiryDate());
		return this;
	}
	
	/**
	 * 仅当前可选单属性赋值接口
	 */
	public static interface CurrentOptionalSingleProperties{
		/** 申请时间 */
		public java.util.Date getApplyDate();
		/** 生成时间 */
		public java.util.Date getGenerateDate();
		/** 发布者 */
		public bairui.international.model.domain.jpa.TB_Admin getPublishor();
		/** 备注 */
		public String getComment();
	}
	
	/**
	 * 为仅当前可选单属性赋值
	 */
	public TB_ElectronicTicketOrder properties(CurrentOptionalSingleProperties properties) {
		this.setApplyDate(properties.getApplyDate());
		this.setGenerateDate(properties.getGenerateDate());
		this.setPublishor(properties.getPublishor());
		this.setComment(properties.getComment());
		return this;
	}
	
	public TB_ElectronicTicketOrder(
		@lombok.NonNull com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean,
		CurrentMustProperties mustProperties,
		CurrentOptionalSingleProperties optionalProperties
	) {
		this(bean);
		this.properties(mustProperties);
		this.properties(optionalProperties);
	}
	
	public TB_ElectronicTicketOrder(
		@lombok.NonNull com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean
	) {
		update(bean);
	}
	
	public TB_ElectronicTicketOrder update(com.lianjing.sh.model.uml.model.data.TBSuper_BaseIDAndTimeAndOrderValue bean){
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		return this;
	}
	
	
	/**
	 * 更新属性内部类
	 */
	public abstract class UpdateProperties {
	
		public UpdateProperties() throws Exception {
			Integer orderValue = getOrderValue(TB_ElectronicTicketOrder.this);
			if(isOverride_getOrderValue){
				TB_ElectronicTicketOrder.this.setOrderValue(orderValue);
			}
	
			String number = getNumber(TB_ElectronicTicketOrder.this);
			if(isOverride_getNumber){
				TB_ElectronicTicketOrder.this.setNumber(number);
			}
	
			String name = getName(TB_ElectronicTicketOrder.this);
			if(isOverride_getName){
				TB_ElectronicTicketOrder.this.setName(name);
			}
	
			Double price = getPrice(TB_ElectronicTicketOrder.this);
			if(isOverride_getPrice){
				TB_ElectronicTicketOrder.this.setPrice(price);
			}
	
			bairui.international.model.type.Type_ElectronicTicket type = getType(TB_ElectronicTicketOrder.this);
			if(isOverride_getType){
				TB_ElectronicTicketOrder.this.setType(type);
			}
	
			Long count = getCount(TB_ElectronicTicketOrder.this);
			if(isOverride_getCount){
				TB_ElectronicTicketOrder.this.setCount(count);
			}
	
			Boolean oneuseFlag = getOneuseFlag(TB_ElectronicTicketOrder.this);
			if(isOverride_getOneuseFlag){
				TB_ElectronicTicketOrder.this.setOneuseFlag(oneuseFlag);
			}
	
			Boolean giveFlag = getGiveFlag(TB_ElectronicTicketOrder.this);
			if(isOverride_getGiveFlag){
				TB_ElectronicTicketOrder.this.setGiveFlag(giveFlag);
			}
	
			Boolean againFlag = getAgainFlag(TB_ElectronicTicketOrder.this);
			if(isOverride_getAgainFlag){
				TB_ElectronicTicketOrder.this.setAgainFlag(againFlag);
			}
	
			java.util.Date applyDate = getApplyDate(TB_ElectronicTicketOrder.this);
			if(isOverride_getApplyDate){
				TB_ElectronicTicketOrder.this.setApplyDate(applyDate);
			}
	
			java.util.Date generateDate = getGenerateDate(TB_ElectronicTicketOrder.this);
			if(isOverride_getGenerateDate){
				TB_ElectronicTicketOrder.this.setGenerateDate(generateDate);
			}
	
			bairui.international.model.status.State_ElectronicTicketOrder state = getState(TB_ElectronicTicketOrder.this);
			if(isOverride_getState){
				TB_ElectronicTicketOrder.this.setState(state);
			}
	
			bairui.international.model.domain.jpa.TB_Admin publishor = getPublishor(TB_ElectronicTicketOrder.this);
			if(isOverride_getPublishor){
				TB_ElectronicTicketOrder.this.setPublishor(publishor);
			}
	
			String comment = getComment(TB_ElectronicTicketOrder.this);
			if(isOverride_getComment){
				TB_ElectronicTicketOrder.this.setComment(comment);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_ElectronicTicketOrderVerifyRecord> electronicTicketOrderVerifyRecords = getElectronicTicketOrderVerifyRecords(TB_ElectronicTicketOrder.this);
			if(isOverride_getElectronicTicketOrderVerifyRecords){
				TB_ElectronicTicketOrder.this.setElectronicTicketOrderVerifyRecords(electronicTicketOrderVerifyRecords);
			}
	
			java.util.List<bairui.international.model.domain.jpa.TB_ElectronicTicket> electronicTickets = getElectronicTickets(TB_ElectronicTicketOrder.this);
			if(isOverride_getElectronicTickets){
				TB_ElectronicTicketOrder.this.setElectronicTickets(electronicTickets);
			}
	
			java.util.Date expiryDate = getExpiryDate(TB_ElectronicTicketOrder.this);
			if(isOverride_getExpiryDate){
				TB_ElectronicTicketOrder.this.setExpiryDate(expiryDate);
			}
		}
	
		public TB_ElectronicTicketOrder up(){
			return TB_ElectronicTicketOrder.this;
		}
	
		/** 排序值 */
		private boolean isOverride_getOrderValue = true;
		public Integer getOrderValue(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getOrderValue = false; 
			return null;
		}
		/** 编号 */
		private boolean isOverride_getNumber = true;
		public String getNumber(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getNumber = false; 
			return null;
		}
		/** 标题 */
		private boolean isOverride_getName = true;
		public String getName(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getName = false; 
			return null;
		}
		/** 面值 */
		private boolean isOverride_getPrice = true;
		public Double getPrice(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getPrice = false; 
			return null;
		}
		/** 类型 */
		private boolean isOverride_getType = true;
		public bairui.international.model.type.Type_ElectronicTicket getType(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getType = false; 
			return null;
		}
		/** 数量 */
		private boolean isOverride_getCount = true;
		public Long getCount(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getCount = false; 
			return null;
		}
		/** 是否一次性 */
		private boolean isOverride_getOneuseFlag = true;
		public Boolean getOneuseFlag(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getOneuseFlag = false; 
			return null;
		}
		/** 是否可赠送 */
		private boolean isOverride_getGiveFlag = true;
		public Boolean getGiveFlag(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getGiveFlag = false; 
			return null;
		}
		/** 是否可再次领取 */
		private boolean isOverride_getAgainFlag = true;
		public Boolean getAgainFlag(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getAgainFlag = false; 
			return null;
		}
		/** 申请时间 */
		private boolean isOverride_getApplyDate = true;
		public java.util.Date getApplyDate(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getApplyDate = false; 
			return null;
		}
		/** 生成时间 */
		private boolean isOverride_getGenerateDate = true;
		public java.util.Date getGenerateDate(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getGenerateDate = false; 
			return null;
		}
		/** 状态 */
		private boolean isOverride_getState = true;
		public bairui.international.model.status.State_ElectronicTicketOrder getState(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getState = false; 
			return null;
		}
		/** 发布者 */
		private boolean isOverride_getPublishor = true;
		public bairui.international.model.domain.jpa.TB_Admin getPublishor(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getPublishor = false; 
			return null;
		}
		/** 备注 */
		private boolean isOverride_getComment = true;
		public String getComment(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getComment = false; 
			return null;
		}
		/** 电子券单审核记录 */
		private boolean isOverride_getElectronicTicketOrderVerifyRecords = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_ElectronicTicketOrderVerifyRecord> getElectronicTicketOrderVerifyRecords(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getElectronicTicketOrderVerifyRecords = false; 
			return null;
		}
		/** 电子券 */
		private boolean isOverride_getElectronicTickets = true;
		public java.util.List<bairui.international.model.domain.jpa.TB_ElectronicTicket> getElectronicTickets(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getElectronicTickets = false; 
			return null;
		}
		/** 有效期 */
		private boolean isOverride_getExpiryDate = true;
		public java.util.Date getExpiryDate(TB_ElectronicTicketOrder it) throws Exception { 
			isOverride_getExpiryDate = false; 
			return null;
		}
	
	}
	
	
	/**
	 * 构造函数
	 */
	public TB_ElectronicTicketOrder() {
	}
	
	public TB_ElectronicTicketOrder(
		@lombok.NonNull Long id
	) {
		this.setId(id);
	}
	
	public TB_ElectronicTicketOrder(
		@lombok.NonNull TB_ElectronicTicketOrder bean
	) {
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		this.setNumber(bean.getNumber());
		this.setName(bean.getName());
		this.setPrice(bean.getPrice());
		this.setType(bean.getType());
		this.setCount(bean.getCount());
		this.setOneuseFlag(bean.getOneuseFlag());
		this.setGiveFlag(bean.getGiveFlag());
		this.setAgainFlag(bean.getAgainFlag());
		this.setApplyDate(bean.getApplyDate());
		this.setGenerateDate(bean.getGenerateDate());
		this.setState(bean.getState());
		this.setCreator(bean.getCreator());
		this.setLastModifier(bean.getLastModifier());
		this.setPublishor(bean.getPublishor());
		this.setComment(bean.getComment());
		this.setElectronicTicketOrderVerifyRecords(bean.getElectronicTicketOrderVerifyRecords());
		this.setElectronicTickets(bean.getElectronicTickets());
		this.setExpiryDate(bean.getExpiryDate());
	}
	
	

	


	/**
	 * 属性
	 */
	@com.lianjing.sh.model.common.annotation.Comment("编号")
	@com.lianjing.sh.processing.info.annotation.InfoComment("编号")
	@javax.persistence.Column(name="number", unique=true, nullable=false, length=32)
	private String number;

	@com.lianjing.sh.model.common.annotation.Comment("标题")
	@com.lianjing.sh.processing.info.annotation.InfoComment("标题")
	@javax.persistence.Column(name="name", nullable=false, length=50)
	private String name;

	@com.lianjing.sh.model.common.annotation.Comment("面值")
	@com.lianjing.sh.processing.info.annotation.InfoComment("面值")
	@javax.persistence.Column(name="price", nullable=false)
	private Double price;

	@com.lianjing.sh.model.common.annotation.Comment("类型")
	@com.lianjing.sh.processing.info.annotation.InfoComment("类型")
	@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)
	@javax.persistence.Column(name="type", nullable=false)
	private bairui.international.model.type.Type_ElectronicTicket type;

	@com.lianjing.sh.model.common.annotation.Comment("数量")
	@com.lianjing.sh.processing.info.annotation.InfoComment("数量")
	@javax.persistence.Column(name="count", nullable=false)
	private Long count;

	@com.lianjing.sh.model.common.annotation.Comment("是否一次性")
	@com.lianjing.sh.processing.info.annotation.InfoComment("是否一次性")
	@javax.persistence.Column(name="oneuseFlag", nullable=false)
	private Boolean oneuseFlag;

	@com.lianjing.sh.model.common.annotation.Comment("是否可赠送")
	@com.lianjing.sh.processing.info.annotation.InfoComment("是否可赠送")
	@javax.persistence.Column(name="giveFlag", nullable=false)
	private Boolean giveFlag;

	@com.lianjing.sh.model.common.annotation.Comment("是否可再次领取")
	@com.lianjing.sh.processing.info.annotation.InfoComment("是否可再次领取")
	@javax.persistence.Column(name="againFlag", nullable=false)
	private Boolean againFlag;

	@com.lianjing.sh.model.common.annotation.Comment("申请时间")
	@com.lianjing.sh.processing.info.annotation.InfoComment("申请时间")
	@javax.persistence.Column(name="applyDate")
	private java.util.Date applyDate;

	@com.lianjing.sh.model.common.annotation.Comment("生成时间")
	@com.lianjing.sh.processing.info.annotation.InfoComment("生成时间")
	@javax.persistence.Column(name="generateDate")
	private java.util.Date generateDate;

	@com.lianjing.sh.model.common.annotation.Comment("状态")
	@com.lianjing.sh.processing.info.annotation.InfoComment("状态")
	@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)
	@javax.persistence.Column(name="state", nullable=false)
	private bairui.international.model.status.State_ElectronicTicketOrder state;

	@com.lianjing.sh.model.common.annotation.Comment("创建者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("创建者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="creator_id", nullable=false)
	@javax.persistence.ManyToOne(optional=false)
	private bairui.international.model.domain.jpa.TB_Admin creator;

	@com.lianjing.sh.model.common.annotation.Comment("最后修改者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("最后修改者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="lastModifier_id", nullable=false)
	@javax.persistence.ManyToOne(optional=false)
	private bairui.international.model.domain.jpa.TB_Admin lastModifier;

	@com.lianjing.sh.model.common.annotation.Comment("发布者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("发布者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToOne()
	private bairui.international.model.domain.jpa.TB_Admin publishor;

	@com.lianjing.sh.model.common.annotation.Comment("备注")
	@com.lianjing.sh.processing.info.annotation.InfoComment("备注")
	@javax.persistence.Column(name="comment", length=500)
	private String comment;

	@com.lianjing.sh.model.common.annotation.Comment("电子券单审核记录")
	@com.lianjing.sh.processing.info.annotation.InfoComment("电子券单审核记录")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="electronicTicketOrder")
	private java.util.List<bairui.international.model.domain.jpa.TB_ElectronicTicketOrderVerifyRecord> electronicTicketOrderVerifyRecords;

	@com.lianjing.sh.model.common.annotation.Comment("电子券")
	@com.lianjing.sh.processing.info.annotation.InfoComment("电子券")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.OneToMany(mappedBy="electronicTicketOrder")
	private java.util.List<bairui.international.model.domain.jpa.TB_ElectronicTicket> electronicTickets;

	@com.lianjing.sh.model.common.annotation.Comment("有效期")
	@com.lianjing.sh.processing.info.annotation.InfoComment("有效期")
	@javax.persistence.Column(name="expiryDate", nullable=false)
	private java.util.Date expiryDate;

	/** get[编号] */
	public String getNumber() {
		return this.number;
	}

	/** get[标题] */
	public String getName() {
		return this.name;
	}

	/** get[面值] */
	public Double getPrice() {
		return this.price;
	}

	/** get[类型] */
	public bairui.international.model.type.Type_ElectronicTicket getType() {
		return this.type;
	}

	/** get[数量] */
	public Long getCount() {
		return this.count;
	}

	/** get[是否一次性] */
	public Boolean getOneuseFlag() {
		return this.oneuseFlag;
	}

	/** get[是否可赠送] */
	public Boolean getGiveFlag() {
		return this.giveFlag;
	}

	/** get[是否可再次领取] */
	public Boolean getAgainFlag() {
		return this.againFlag;
	}

	/** get[申请时间] */
	public java.util.Date getApplyDate() {
		return this.applyDate;
	}

	/** get[生成时间] */
	public java.util.Date getGenerateDate() {
		return this.generateDate;
	}

	/** get[状态] */
	public bairui.international.model.status.State_ElectronicTicketOrder getState() {
		return this.state;
	}

	/** get[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin getCreator() {
		return this.creator;
	}

	/** get[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin getLastModifier() {
		return this.lastModifier;
	}

	/** get[发布者] */
	public bairui.international.model.domain.jpa.TB_Admin getPublishor() {
		return this.publishor;
	}

	/** get[备注] */
	public String getComment() {
		return this.comment;
	}

	/** get[电子券单审核记录] */
	public java.util.List<bairui.international.model.domain.jpa.TB_ElectronicTicketOrderVerifyRecord> getElectronicTicketOrderVerifyRecords() {
		return this.electronicTicketOrderVerifyRecords;
	}

	/** get[电子券] */
	public java.util.List<bairui.international.model.domain.jpa.TB_ElectronicTicket> getElectronicTickets() {
		return this.electronicTickets;
	}

	/** get[有效期] */
	public java.util.Date getExpiryDate() {
		return this.expiryDate;
	}

	/** set[编号] */
	public void setNumber(String number) {
		this.number = number;
	}

	/** set[标题] */
	public void setName(String name) {
		this.name = name;
	}

	/** set[面值] */
	public void setPrice(Double price) {
		this.price = price;
	}

	/** set[类型] */
	public void setType(bairui.international.model.type.Type_ElectronicTicket type) {
		this.type = type;
	}

	/** set[数量] */
	public void setCount(Long count) {
		this.count = count;
	}

	/** set[是否一次性] */
	public void setOneuseFlag(Boolean oneuseFlag) {
		this.oneuseFlag = oneuseFlag;
	}

	/** set[是否可赠送] */
	public void setGiveFlag(Boolean giveFlag) {
		this.giveFlag = giveFlag;
	}

	/** set[是否可再次领取] */
	public void setAgainFlag(Boolean againFlag) {
		this.againFlag = againFlag;
	}

	/** set[申请时间] */
	public void setApplyDate(java.util.Date applyDate) {
		this.applyDate = applyDate;
	}

	/** set[生成时间] */
	public void setGenerateDate(java.util.Date generateDate) {
		this.generateDate = generateDate;
	}

	/** set[状态] */
	public void setState(bairui.international.model.status.State_ElectronicTicketOrder state) {
		this.state = state;
	}

	/** set[创建者] */
	public void setCreator(bairui.international.model.domain.jpa.TB_Admin creator) {
		this.creator = creator;
	}

	/** set[最后修改者] */
	public void setLastModifier(bairui.international.model.domain.jpa.TB_Admin lastModifier) {
		this.lastModifier = lastModifier;
	}

	/** set[发布者] */
	public void setPublishor(bairui.international.model.domain.jpa.TB_Admin publishor) {
		this.publishor = publishor;
	}

	/** set[备注] */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/** set[电子券单审核记录] */
	public void setElectronicTicketOrderVerifyRecords(java.util.List<bairui.international.model.domain.jpa.TB_ElectronicTicketOrderVerifyRecord> electronicTicketOrderVerifyRecords) {
		this.electronicTicketOrderVerifyRecords = electronicTicketOrderVerifyRecords;
	}

	/** set[电子券] */
	public void setElectronicTickets(java.util.List<bairui.international.model.domain.jpa.TB_ElectronicTicket> electronicTickets) {
		this.electronicTickets = electronicTickets;
	}

	/** set[有效期] */
	public void setExpiryDate(java.util.Date expiryDate) {
		this.expiryDate = expiryDate;
	}






	/** add[ElectronicTicketOrderVerifyRecords] */
	public TB_ElectronicTicketOrder addElectronicTicketOrderVerifyRecords(bairui.international.model.domain.jpa.TB_ElectronicTicketOrderVerifyRecord ... electronicTicketOrderVerifyRecords){
		if(this.electronicTicketOrderVerifyRecords == null){
			this.electronicTicketOrderVerifyRecords = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_ElectronicTicketOrderVerifyRecord bean : electronicTicketOrderVerifyRecords){
			bean.setElectronicTicketOrder(this);
			this.electronicTicketOrderVerifyRecords.add(bean);
		}
		return this;
	}
	/** add[ElectronicTickets] */
	public TB_ElectronicTicketOrder addElectronicTickets(bairui.international.model.domain.jpa.TB_ElectronicTicket ... electronicTickets){
		if(this.electronicTickets == null){
			this.electronicTickets = new java.util.ArrayList<>();
		}
		for(bairui.international.model.domain.jpa.TB_ElectronicTicket bean : electronicTickets){
			bean.setElectronicTicketOrder(this);
			this.electronicTickets.add(bean);
		}
		return this;
	}
	
	/** remove[ElectronicTicketOrderVerifyRecords] */
	public TB_ElectronicTicketOrder removeElectronicTicketOrderVerifyRecords(bairui.international.model.domain.jpa.TB_ElectronicTicketOrderVerifyRecord ... electronicTicketOrderVerifyRecords){
		if(this.electronicTicketOrderVerifyRecords == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_ElectronicTicketOrderVerifyRecord bean : electronicTicketOrderVerifyRecords){
			bean.setElectronicTicketOrder(null);
			this.electronicTicketOrderVerifyRecords.remove(bean);
		}
		return this;
	}
	/** remove[ElectronicTickets] */
	public TB_ElectronicTicketOrder removeElectronicTickets(bairui.international.model.domain.jpa.TB_ElectronicTicket ... electronicTickets){
		if(this.electronicTickets == null){
			return this;
		}
		for(bairui.international.model.domain.jpa.TB_ElectronicTicket bean : electronicTickets){
			bean.setElectronicTicketOrder(null);
			this.electronicTickets.remove(bean);
		}
		return this;
	}
	
	/**
	 * contains[ElectronicTicketOrderVerifyRecords]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsElectronicTicketOrderVerifyRecords(bairui.international.model.domain.jpa.TB_ElectronicTicketOrderVerifyRecord ... electronicTicketOrderVerifyRecords){
		if(this.electronicTicketOrderVerifyRecords == null || electronicTicketOrderVerifyRecords==null || electronicTicketOrderVerifyRecords.length<=0){
			return false;
		}
		return this.electronicTicketOrderVerifyRecords.containsAll(java.util.Arrays.asList(electronicTicketOrderVerifyRecords));
	}
	/**
	 * contains[ElectronicTickets]
	 *
	 * 全部输入都包含：返回 true
	 * 输入中有至少有一个不包含：返回 false
	 */
	public boolean containsElectronicTickets(bairui.international.model.domain.jpa.TB_ElectronicTicket ... electronicTickets){
		if(this.electronicTickets == null || electronicTickets==null || electronicTickets.length<=0){
			return false;
		}
		return this.electronicTickets.containsAll(java.util.Arrays.asList(electronicTickets));
	}
	

	/** take[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin takeCreator(){
		if(null == this.creator){
			this.creator = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.creator;
	}
	
	/** take[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin takeLastModifier(){
		if(null == this.lastModifier){
			this.lastModifier = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.lastModifier;
	}
	
	/** take[发布者] */
	public bairui.international.model.domain.jpa.TB_Admin takePublishor(){
		if(null == this.publishor){
			this.publishor = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.publishor;
	}
	
	/** must[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin mustCreator() {
		return this.creator;
	}
	
	/** must[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin mustLastModifier() {
		return this.lastModifier;
	}
	
	/** optional[发布者] */
	public java.util.Optional<bairui.international.model.domain.jpa.TB_Admin> optionalPublishor() {
		return java.util.Optional.ofNullable(this.publishor);
	}
	

	/**
	 * 复写 hashCode
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		return prime * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
	}
	
	/**
	 * 复写 equals
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj){
			return true;
		}
		if (obj == null){
			return false;
		}
		if (getClass() != obj.getClass()){
			return false;
		}
		TB_ElectronicTicketOrder other = (TB_ElectronicTicketOrder) obj;
		if (this.getId() == null) {
			return false;
		} else if (!this.getId().equals(other.getId())){
			return false;
		}
		return true;
	}
	

	/**
	 * 用来覆盖toString()的输出
	 */
	@javax.persistence.Transient
	private String toString;
	
	public void setToString(String toString) {
		this.toString = toString;
	}
	
	/**
	 * 复写 toString
	 */
	@Override
	public String toString() {
		if(null != this.toString){
			return this.toString;
		}
		String name = this.getName();
		if(null != name){
			return String.valueOf(name);
		}
		return super.toString();
	}	

	@javax.persistence.PrePersist
	public void prePersist() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setCreateTime(new java.util.Date());
		this.setModifyTime(new java.util.Date());
		this.setCreator((bairui.international.model.domain.jpa.TB_Admin)user);
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}
	
	@javax.persistence.PreUpdate
	public void preUpdate() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setModifyTime(new java.util.Date());
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}

	/**
	 * 状态相关
	 */
	public bairui.international.model.status.State_ElectronicTicketOrder state(){
		return this.getState();
	}


}
